// 1.引入 vue核心库
import Vue from 'vue'
// 2.引入路由
import VueRouter  from 'vue-router'


//7.导入vue组件
import UserDao from '@/components/UserDao.vue'
import Login from '@/views/Login.vue'
import Home from '@/views/Home.vue'
import Member from '@/views/Member.vue'
import Branch from '@/views/Branch.vue'
import Get from '@/components/Get.vue'
import Post from '@/components/Post.vue'
import Axios1 from '@/components/Axios1.vue'
import Axios from '@/components/Axios.vue'


// 3.安装插值 
Vue.use(VueRouter)
// 4.定义路由
const routes=[
    {
        path:'/axios',
        component: Axios,
        name:'Axios'
    },
    {
        path:'/axios1',
        component: Axios1,
        name:'Axios1'
    },
    {
        path:'/post',
        component: Post,
        name:'Post'
    },
     {
        path:'/get',
        component: Get,
        name:'Get'
    },
    {
        path:'/login',
        component: Login,
        name:'Login'
    },
    {
        path:'/',
        component: Home,
        name:'Home',
        // meta:{requiresAuth:true},
        children:[
              { path: 'member', name: 'Member', component: Member },
              { path: 'branch', name: 'Branch', component: Branch },
        ]
    },

    {
        path:'/userdao',
        component: UserDao,
        name:'UserDao'
    }
]

// 5. 创建路由的实例对象
const router = new VueRouter({
    mode:'history',
    routes

})

// 6.导出路由
export default router